#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by master on 2017/2/25
import copy

dic = {
    "cpu": [80, ],
    "memory": [80, ],
    "disk": [80, ]
}

print("before", dic)

new_dic1 = copy.copy(dic)
new_dic = copy.deepcopy(dic)

new_dic1["cpu"][0] = 50  # 浅拷贝 因为两份数据指向的还是同一个内存地址，所以把原来的数据也改变了
new_dic["cpu"][0] = 50  # 深拷贝 不会影响原来的数据
print(dic)
print(new_dic1)
print(new_dic)
